<?php
	
	//-----------kiem tra email---------
	function check_email($email)
	{
    if (strlen($email) == 0) return false;
    if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) return true;
    return false;
	}
	//----------------------------------------
	function convertDateVE($vd)
	{
		//$vd: nn/tt/nnnn
		$ss = explode("/", $vd); //Tach xau
		return ($ss[2]."-".$ss[1]."-".$ss[1]."-".$ss[0]);
	}

	//---------------------------------------
	function convertDateEV($ed)
	{
		$ss = explode("-", $ed); //Tach xau
		return ($ss[2]."/".$ss[1]."/".$ss[0]);
	}
?>